<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <model-input :title.sync="title"></model-input>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
      const print = {
        props: ['title'],
        template: `
                <div>
                    <input type="text" :value='title' @keyup='changeTitle'>
                     <span>{{title}}</span>
                </div>
            `,
        methods: {
          changeTitle(e) {
            this.$emit('update:title', e.target.value)
          }
        }
      }
      new Vue({
        el: '#app',
        data: {
          title: 'aaa'
        },
        components: {
          'model-input': print
        }
      })
    </script>
  </body>
</html>
